function request(path, method, data, transfer, successCallback, errorCallback) {
	require('winged/utils/axios');
	let caller = null;
	if (transfer) {
		caller = window.axios.wtCall(path, method, data);
	}
	else {
		caller = window.axios({
			method: method,
			url: path,
			data: data
		});
	}
	caller.then(function(response) {
		let successful = true; 
		if (response.status != 200) {
			successful = false;
		}
		else {
			if (transfer && response.data.status != 200) {
				successful = false;
			}
		}

		if (successful) {
			let data = null;
			if (transfer) {
				data = response.data.content;
			}
			else {
				data = response.data.data;
			}
			console.log(data);
			successCallback(data);
		}
		else {
			errorCallback('request failed');
		}
	})
	.catch(function(error) {
		errorCallback(error);
	}) 
}

export default request;